<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="stylesheet" href="../../../yl/index.css" />
    <link rel="stylesheet" href="../../../style/index.css" />
    <title>项目信息</title>
    <style>
        .el-form-item__content{
            display: block;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <div class="title">
            <div style="padding: 5px;">
                项目名称<el-input v-model="page.value1" style="width: 200px; margin:0 10px; "
                    placeholder="请输入项目名称"></el-input>
                <el-button icon="Search" style="margin: 0; margin-right: 10px;" @click="check">查询</el-button>
                <el-button icon="Refresh" style="margin: 0; margin-right: 10px;" @click="reset">重置</el-button>

                <el-button type="primary" icon="CirclePlus" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>添加</el-button>
                <!-- <el-button type="warning" icon="Download" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导入</el-button>
                <el-button type="success" icon="Upload" style="margin: 0; margin-right: 10px;" @click="personalAdd"
                    plain round>批量导出</el-button>
                <el-button type="danger" icon="Delete" style="margin: 0; margin-right: 10px;" @click="personalAdd" plain
                    round>批量删除</el-button> -->
            </div>
        </div>
        <div class="body">
            <div class="left">
                <el-tree ref="tree" id="tree" default-expand-all :expand-on-click-node="false"
                    :data-options="JSON.stringify({ 'TableName': 'government_agencies', 'NodeCode': '','primary_key':'Government_Agencies_SerialNumber' })"
                    style="max-width: 600px" :data="treeData" @node-click="handleNodeClick"
                    :props="{ label: 'Agensies_Name' }">
                    <template #default="{ node, data }">
                        <div class="custom-tree-node">
                            <span>{{ node.label }}</span>
                            <!-- <div>
                                <el-button v-if="node.level != 2" type="primary" link @click="personalAdds(data)">+</el-button>
                                <el-button type="primary" link @click="handleEdits(data)">编辑</el-button>
                                <el-button style="margin-left: 4px" type="danger" link @click="remove(node, data)">删除</el-button>
                            </div> -->
                        </div>
                    </template>
                </el-tree>
            </div>
            <div class="right">
                <el-tabs v-model="page.activeName" type="card" @tab-click="handleClick">
                    <el-tab-pane name="first">
                        <template #label>
                            全部
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="second">
                        <template #label>
                            待审核
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="third">
                        <template #label>
                            已通过
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="fourth">
                        <template #label>
                            已拒绝
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="fifth">
                        <template #label>
                            进行中
                        </template>
                    </el-tab-pane>
                    <el-tab-pane name="sixth">
                        <template #label>
                            已完成
                        </template>
                    </el-tab-pane>
                </el-tabs>
                <el-table id="table" border
                    :data-options="JSON.stringify({ 'TableName': 'project','primary_key':'Project_SerialNumber'})"
                    height="450" v-loading="loading" ref="multipleTable" tooltip-effect="dark" :data="Tabletdata"
                    @selection-change="handleSelectionChange">
                    <el-table-column width="50" align="center" label="#">
                        <template v-slot="{row}">
                            <div style="width: 10px;height: 10px;border-radius: 50%;display: inline-block;"
                                :style="{backgroundColor:row.Color}"></div>
                        </template>
                    </el-table-column>
                    <el-table-column min-width="180" show-overflow-tooltip v-for="column in columns" :key="column.COLUMN_NAME"
                        :prop="column.COLUMN_NAME" :label="column.COLUMN_COMMENT">
                        <template v-slot="{row}">
                            <div v-if="isValueType(row[column.COLUMN_NAME])=='image'">
                                <el-image style="width: 100px; height: 100px" :src="photo + row[column.COLUMN_NAME]"
                                    fit="contain"></el-image>
                            </div>
                            <div v-else>
                                {{row[column.COLUMN_NAME]}}
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column width="150" fixed="right" align="center" label="紧急程度">
                        <template v-slot="{row}">
                            {{row.Emergency_Sign}}
                        </template>
                    </el-table-column>
                    <el-table-column width="100" fixed="right" align="center" label="状态">
                        <template v-slot="{row}">
                            <el-tag
                                :type="row.Project_Status=='0'?'primary':row.Project_Status=='1'?'warning':row.Project_Status=='2'?'success':row.Project_Status=='3'?'danger':row.Project_Status=='4'?'warning':row.Project_Status=='5'?'success':row.Project_Status=='6'?'warning':row.Project_Status=='7'?'danger':''">
                                {{row.Project_Status=='0'?'已提交':row.Project_Status=='1'?'待审核':row.Project_Status=='2'?'已通过':row.Project_Status=='3'?'已拒绝':row.Project_Status=='4'?'进行中':row.Project_Status=='5'?'已完成':row.Project_Status=='6'?'竣工验收':row.Project_Status=='7'?'返工':''}}
                            </el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column width="120" prop="Reason" fixed="right" align="center" show-overflow-tooltip
                        label="拒绝原因"></el-table-column>
                    <el-table-column label="操作" fixed="right" width="142">
                        <template #default="{row}">
                            <div style="display: flex; align-items: center;">
                                <el-button style="margin-right: 10px;" size="small"
                                    @click="handleEdit(row)">
                                    {{row.Project_Status!='3'?'查看':'编辑'}}
                                </el-button>
                                <el-dropdown trigger="click">
                                    <el-button size="small">
                                        更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
                                    </el-button>
                                    <template #dropdown>
                                        <el-dropdown-menu>
                                            <el-dropdown-item v-if="row.Project_Status == '1'" @click="examine(row)">
                                                审核
                                            </el-dropdown-item>
                                            <template v-if="row.Project_Status == '6'">
                                                <el-dropdown-item @click="examine1(row,'5')">
                                                    通过（竣工）
                                                </el-dropdown-item>
                                                <el-dropdown-item @click="examine1(row,'7')">
                                                    拒绝（竣工）
                                                </el-dropdown-item>
                                            </template>
                                            <el-dropdown-item v-if="row.Project_Status == '7'" @click="handleRework(row)">
                                                返工
                                            </el-dropdown-item>
                                            <el-dropdown-item @click="handleDelete(row)">
                                                删除
                                            </el-dropdown-item>
                                        </el-dropdown-menu>
                                    </template>
                                </el-dropdown>
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination style="margin-top: 1%;" :current-page="page.PageNumber" :page-size="page.RowAmount"
                    :page-sizes="[10, 100, 200, 300, 400]" layout="total, sizes, prev, pager, next, jumper"
                    :total="Total" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
            </div>
        </div>
        <el-dialog v-model="showDialog" width="550" class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>设置显示字段</span>
                </div>
            </template>
            <div class="dialog-content">
                <el-checkbox v-model="isAllChecked" @change="handleAllChecked"
                    class="full-width-checkbox">全选</el-checkbox>
                <div class="checkbox-columns">
                    <el-checkbox-group v-model="checkedFields" style="width: 100%; display: flex; flex-wrap: wrap">
                        <el-checkbox :disabled="field.COLUMN_KEY === 'PRI'" v-for="field in fields" :key="field"
                            :value="field" style="width: 50%; height: 30px; margin-right: 0px">
                            {{ field.COLUMN_COMMENT }}
                        </el-checkbox>
                    </el-checkbox-group>
                </div>
            </div>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog = false" class="cancel-btn">取消</el-button>
                    <el-button type="primary" @click="saveFields" class="confirm-btn">保存</el-button>
                </div>
            </template>
        </el-dialog>
        <el-dialog v-model="showDialog1" width="700" class="custom-dialog">
            <template #header>
                <div class="dialog-header">
                    <span>返工佐证</span>
                </div>
            </template>
            <div class="dialog-content">
                <el-form :model="{project_examine_log_attachment}" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions style="width: 100%;margin-top: 10px;" :column="1" size="large" border>
                        <el-descriptions-item>
                            <template #label>
                                <div class="cell-item">返工佐证</div>
                            </template>
                            <el-form-item prop="project_examine_log_attachment">
                                <yl-upload ref="ylUpload" drag @success="success" @remove="remove" :limit="99"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-form>
            </div>
            <template #footer>
                <div class="dialog-footer">
                    <el-button @click="showDialog1 = false" class="cancel-btn">取消</el-button>
                    <el-button type="primary" :loading="loading" @click="handleSubmit(form)" class="confirm-btn">保存</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
    </div>
    <script src="../../../utils/utils.js"></script>
    <script src="../../../config/config.js"></script>
    <script src="../../../utils/mixins.js"></script>
    <script src="../../../yl/vue.js"></script>
    <script src="../../../yl/index.js"></script>
    <script src="../../../yl/zh-cn.mjs"></script>
    <script src="../../../yl/index.iife.min.js"></script>
    <script src="../../../yl/jquery.min.js"></script>
    <script src="../../../utils/jquery.cookie.js"></script>
    <script src="../../../api/request.js"></script>
    <script src="js/index.js"></script>
</body>

</html>